<template>
  <div>
    <div class="fileResourceManage" id="dropTarget">
      <div
        id="drop_area"
        :class="{ borderHover: isBorderHover, noBorderHover: !isBorderHover }"
        style="width: 100%; height: 100%"
      >
        <div>
          <div v-if="isBorderHover" class="dragTitle">
            <p>请将文件拖拽到当前区域进行上传！</p>
          </div>
          <CCard class="contentCard">
            <CCardHeader>
              <strong class="title">文件资源管理</strong>
            </CCardHeader>
            <CCardBody>
              <CRow class="contentRow">
                <CCard class="leftCard">
                  <div class="treeDiv">
                    <ul id="treeDemo" class="ztree"></ul>
                  </div>
                </CCard>
                <CCard class="rightCard">
                  <CRow class="header" style="margin-left: 0px">
                    <template>
                      <div class="contentHeader">
                        当前位置：
                        <Breadcrumb separator=">">
                          <BreadcrumbItem
                            v-for="(item, index) in breadcrumbItemList"
                            :key="index"
                            @click.native="breadCrumbChange(item, index)"
                            >{{ item.name }}</BreadcrumbItem
                          >
                        </Breadcrumb>
                      </div>
                    </template>
                  </CRow>
                  <CRow class="operationNav" style="margin-left: 0px">
                    <div class="operationNavDiv">
                      <CButton
                        title="上一级"
                        variant="outline"
                        color="info"
                        @click="up"
                        id="upLevelbtn"
                      >
                        <img src="../../assets/icons/fileResource/up.gif" alt />
                        <p>向上</p>
                      </CButton>
                      <CButton
                        title="根目录"
                        variant="outline"
                        color="info"
                        @click="getRootDirectory"
                      >
                        <img src="../../assets/icons/fileResource/home.gif" alt />
                        <p>根目录</p>
                      </CButton>
                      <CButton
                        title="刷新"
                        variant="outline"
                        color="info"
                        @click="refreshTable"
                      >
                        <img src="../../assets/icons/fileResource/refersh.gif" alt />
                        <p>刷新</p></CButton
                      >
                      <CButton
                        title="新目录"
                        variant="outline"
                        color="info"
                        @click="createNewFolder"
                      >
                        <img src="../../assets/icons/fileResource/newfolder.gif" alt />
                        <p>新目录</p></CButton
                      >
                      <!-- <CButton
                        title="新文件"
                        variant="outline"
                        color="info"
                        @click="createNewFile"
                      >
                        <img
                          src="../../assets/icons/fileResource/newfile.gif"
                          alt
                        />
                        <p>新文件</p></CButton
                      > -->
                      <CButton
                        title="删除"
                        variant="outline"
                        color="info"
                        @click="deleteFile"
                      >
                        <img src="../../assets/icons/fileResource/delete.gif" alt />
                        <p>删除</p></CButton
                      >
                      <CButton title="剪切" variant="outline" color="info" @click="cut">
                        <img src="../../assets/icons/fileResource/cut.gif" alt />
                        <p>剪切</p></CButton
                      >
                      <CButton title="复制" variant="outline" color="info" @click="copy">
                        <img src="../../assets/icons/fileResource/copy.gif" alt />
                        <p>复制</p></CButton
                      >
                      <CButton title="粘贴" variant="outline" color="info" @click="paste">
                        <img src="../../assets/icons/fileResource/paste.gif" alt />
                        <p>粘贴</p></CButton
                      >
                      <CButton
                        title="压缩"
                        variant="outline"
                        @click="compress"
                        color="info"
                      >
                        <img src="../../assets/icons/fileResource/zipfile.gif" alt />
                        <p>压缩</p></CButton
                      >
                      <CButton
                        title="解压"
                        variant="outline"
                        @click="unCompress"
                        color="info"
                      >
                        <img src="../../assets/icons/fileResource/unzip.gif" alt />
                        <p>解压</p></CButton
                      >
                      <CButton
                        title="'下载'"
                        variant="outline"
                        color="info"
                        @click="getDownLoadKey"
                      >
                        <img src="../../assets/icons/fileResource/download.gif" alt />
                        <p>下载</p></CButton
                      >
                      <CButton
                        title="上传文件"
                        variant="outline"
                        color="info"
                        @click="uploaderFile"
                      >
                        <img src="../../assets/icons/fileResource/upload.gif" alt />
                        <p>上传文件</p></CButton
                      >
                      <CButton
                        title="上传文件夹"
                        variant="outline"
                        color="info"
                        @click="uploaderFolder"
                      >
                        <img src="../../assets/icons/fileResource/upload.gif" alt />
                        <p>上传文件夹</p></CButton
                      >

                      <CButton
                        title="重命名"
                        variant="outline"
                        color="info"
                        @click="reName()"
                      >
                        <img
                          src="../../assets/icons/fileResource/rename.gif"
                          alt
                          style="width: 24px; height: 24px"
                        />
                        <p style="padding-top: 7px">重命名</p></CButton
                      >

                      <CButton
                        title="传输列表"
                        variant="outline"
                        color="info"
                        @click="uploaderFilelist"
                      >
                        <img src="../../assets/icons/fileResource/upload.gif" alt />
                        <p>传输列表</p></CButton
                      >
                    </div>
                  </CRow>
                  <CRow class="content" style="margin-left: 0px">
                    <Table
                      border
                      :draggable="tableDraggable"
                      :columns="getColumn"
                      :data="fileListData"
                      class="fileTableStyle"
                      @on-row-dblclick="rowDbclick"
                      @on-selection-change="selectChange"
                    >
                      <!-- <template slot="action" slot-scope="{ row, index }">
                            <CButton
                              v-c-tooltip="'重命名'"
                              title="重命名"
                              variant="outline"
                              color="info"
                              size="sm"
                              @click="reName(row, index)"
                            >
                              <img
                                src="../../assets/icons/fileResource/rename.gif"
                                alt
                              />
                            </CButton>
                      </template> -->

                      <template slot="type" slot-scope="{ row }">
                        <span>
                          <img class="levestyle" :src="fileTypeImg(row.type)" alt
                        /></span>
                      </template>
                    </Table>

                    <Spin fix v-if="isLoading">
                      <Icon
                        type="ios-loading"
                        size="50"
                        class="demo-spin-icon-load"
                      ></Icon>
                      <div>{{ loadingText }}</div>
                    </Spin>
                  </CRow>
                </CCard>
              </CRow>
            </CCardBody>
          </CCard>
        </div>
      </div>



      <Modal
        v-model="createFolderModal"
        draggable
        scrollable
        title="新增"
        :styles="modalStyle"
      >
        <p slot="header" class="modalHeader">新增</p>
        <CButtonClose slot="close" @click="createFolderOrFileCancel" />
        <div class="saveFile">
          <CInput
            label="文件名称:"
            class="saveFileStyle"
            horizontal
            v-model="newFileName"
            v-show="fileInput"
          />
        </div>
        <div class="saveFolder">
          <CInput
            label="文件夹名称:"
            class="saveFileStyle"
            horizontal
            v-model="newFileName"
            v-show="folderInput"
          />
        </div>
        <template #footer>
          <CButton @click="createFolderOrFileOk" color="info">确定</CButton>
          <CButton @click="createFolderOrFileCancel" color="info">取消</CButton>
        </template>
      </Modal>
      <Modal
        v-model="delShow"
        draggable
        scrollable
        title="删除文件"
        :width="600"
        :styles="modalStyle"
      >
        <p slot="header" class="modalHeader">
          <img src="@/assets/icons/shanchu.svg" alt />
          <span>删除文件</span>
        </p>
        <div class="modalBody">
          <p>是否删除文件</p>
          <p>请确认是否删除?</p>
        </div>
        <template #footer class="footerBtns">
          <CButton @click="delCancel" color="info" class="delAnniu">取消</CButton>
          <CButton @click="delOk" color="info">确定</CButton>
        </template>
      </Modal>
      <Modal
        v-model="reNameModal"
        draggable
        scrollable
        title="修改名称"
        :styles="modalStyle"
      >
        <p slot="header" class="modalHeader">重命名</p>
        <CButtonClose slot="close" @click="createFolderOrFileCancel" />
        <div class="saveFile">
          <CInput
            label="文件新名称:"
            class="saveFileStyle"
            horizontal
            v-model="newFileName"
          />
        </div>
        <template #footer>
          <CButton @click="reNameOk" color="info">确定</CButton>
          <CButton @click="reNameCancel" color="info">取消</CButton>
        </template>
      </Modal>
      <Modal
        v-model="compressModal"
        draggable
        title="压缩文件名和参数设置"
        :styles="modalStyle"
      >
        <p slot="header" class="modalHeader">压缩文件名和参数设置</p>

        <div class="modalBody">
          <CInput
            label="压缩文件名:"
            class="saveFileStyle"
            horizontal
            v-model="compressName"
          />
          <CSelect
            label="压缩文件格式"
            horizontal
            :options="suffixOptions"
            :value.sync="currentCompressSuffix"
            class="selectSuffix"
          >
          </CSelect>
        </div>

        <template #footer>
          <CButton @click="compressOk" color="info">确定</CButton>
          <CButton @click="compressCancel" color="info">取消</CButton>
        </template>
      </Modal>
    </div>
  </div>
</template>
<script>

import Bus from "./js/bus";
// import GlobalUploader from "@/view/fileManage/globalUploader";
export default {
  name: "fileResourceManage",
  props: ["modalShow"],

  computed: {
    getColumn() {
      let that = this;
      return [
        // 类型 名称 大小 最后更新
        {
          type: "selection",
          width: 60,
          align: "center",
          resizable: true,
        },
        {
          slot: "type",
          key: "type",
          title: "类型",
          align: "center",
          width: 90,
          resizable: true,
    /*    sortable: true,
          sortMethod: this.sortType,
          sortType:"desc",*/
          renderHeader:(h,params)=>{
            return h("div",{style:{display:"flex"}},[
                   h("div",{style:{}},"类型"),
                   h("div",{style:{display:"flex", "flex-direction": "column",marginLeft:"8px",marginTop:"-2px"}},[
                      h("i" ,{
                        'class': {fa: true, "fa-caret-up": true, "sortButtonClass":this.sortButtonClass==="sortTypeUpClass"},
                        style:{marginBottom:"-5px"},
                        on: {"click": that.sortTypeUp},},``),
                     h("i" ,{
                       'class': {fa: true, "fa-caret-down": true,"sortButtonClass":this.sortButtonClass==="sortTypeDownClass"},
                       on: {"click": that.sortTypeDown},},``),
                  ]),
            ])
          }
        },
        {
          key: "name",
          title: "名称",
          align: "left",
          width: "auto",
          resizable: true,
  /*        sortable: true,
          sortMethod: this.sortMethod,*/
          renderHeader:(h,params)=>{
            return h("div",{style:{display:"flex"}},[
              h("div",{style:{}},"名称"),
              h("div",{style:{display:"flex", "flex-direction": "column",marginLeft:"8px",marginTop:"-2px"}},[
                h("i" ,{
                  'class': {fa: true, "fa-caret-up": true, "sortButtonClass":this.sortButtonClass==="sortMethodUpClass"},
                  style:{marginBottom:"-5px"},
                  on: {"click": that.sortMethodUp},},``),
                h("i" ,{
                  'class': {fa: true, "fa-caret-down": true, "sortButtonClass":this.sortButtonClass==="sortMethodDownClass"},
                  on: {"click": that.sortMethodDown},},``),
              ]),
            ])
          },
          render: (h, params) => {
            return h("div", [
              h(
                "div",
                {
                  style: {
                    display: "inline-block",
                    width: "100%",
                    overflow: "hidden",
                    textOverflow: "ellipsis",
                    whiteSpace: "nowrap",
                  },
                  domProps: {
                    title: params.row.path,
                  },
                  props: {
                    color: "info",
                    variant: "outline",
                  },

                  on: {
                    click: () => {
                      if (params.row.$isEdit) {
                        return h("Input", {
                          props: {
                            type: "text",
                            value: params.row.name,
                          },
                        });
                        // this.handleSave(params.row, params.index);
                      } else {
                        // this.handleEdit(params.row, params.index);
                      }
                    },
                  },
                },
                params.row.name
              ),
            ]);

            if (params.row.$isEdit) {
              return h("Input", {
                props: {
                  type: "text",
                  value: params.row.name,
                },
                on: {
                  "on-blur": (event) => {
                    params.row.name = event.target.value;
                    this.fileListData[params.index].name = event.target.value;
                    this.$set(params.row, "$isEdit", false);
                  },
                },
              });
            } else {
              return h(
                "div",
                {
                  on: {
                    click: () => {
                      this.$set(params.row, "$isEdit", true);
                    },
                  },
                },
                params.row.name
              );
            }
          },
        },
        {
          key: "size",
          title: "大小",
          align: "center",
          width: 120,
          resizable: true,
/*          sortable: true,
          sortMethod: this.sortSize,*/
          renderHeader:(h,params)=>{
            return h("div",{style:{display:"flex"}},[
              h("div",{style:{}},"大小"),
              h("div",{style:{display:"flex", "flex-direction": "column",marginLeft:"8px",marginTop:"-2px"}},[
                h("i" ,{
                  'class': {fa: true, "fa-caret-up": true,"sortButtonClass":this.sortButtonClass==="sortSizeUpClass"},
                  style:{marginBottom:"-5px"},
                  on: {"click": that.sortSizeUp},},``),
                h("i" ,{
                  'class': {fa: true, "fa-caret-down": true,"sortButtonClass":this.sortButtonClass==="sortSizeDownClass"},
                  on: {"click": that.sortSizeDown},},``),
              ]),
            ])
          },
          render: (h, params) => {
            return h("div", [
              h(
                "div",
                {
                  style: {
                    display: "inline-block",
                    width: "100%",
                    overflow: "hidden",
                    textOverflow: "ellipsis",
                    whiteSpace: "nowrap",
                  },
                  domProps: {
                    title: params.row.size,
                  },
                  props: {
                    color: "info",
                    variant: "outline",
                  },
                },
                params.row.size
              ),
            ]);
          },
        },
        {
          key: "time",
          title: "修改日期",
          align: "center",
          width: 200,
          resizable: true,
 /*         sortable: true,
          sortMethod: this.sortTime,*/
          renderHeader:(h,params)=>{
            return h("div",{style:{display:"flex"}},[
              h("div",{style:{}},"修改日期"),
              h("div",{style:{display:"flex", "flex-direction": "column",marginLeft:"8px",marginTop:"-2px"}},[
                h("i" ,{
                  'class': {fa: true, "fa-caret-up": true,"sortButtonClass":this.sortButtonClass==="sortTimeUpClass"},
                  style:{marginBottom:"-5px"},
                  on: {"click": that.sortTimeUp},},``),
                h("i" ,{
                  'class': {fa: true, "fa-caret-down": true,"sortButtonClass":this.sortButtonClass==="sortTimeDownClass"},
                  on: {"click": that.sortTimeDown},},``),
              ]),
            ])
          },
          render: (h, params) => {
            return h("div", [
              h(
                "div",
                {
                  style: {
                    display: "inline-block",
                    width: "100%",
                    overflow: "hidden",
                    textOverflow: "ellipsis",
                    whiteSpace: "nowrap",
                  },
                  domProps: {
                    title: params.row.time,
                  },
                  props: {
                    color: "info",
                    variant: "outline",
                  },
                },
                params.row.time
              ),
            ]);
          },
        },
        // {
        //   title: "重命名",
        //   width: 100,
        //   slot: "action",
        //   align: "center",
        //   resizable: true,
        // },
      ];
    },
    getFileDir() {
        let dirArr = this.fileListData.filter((item) => {
          return item.type === "dir";
        });

      let dirSortArr = dirArr.sort((a, b) => {
        return a.name > b.name ? 1 : -1;
      });
        return dirSortArr;
    },
    getFileNoDir(){
        let dirArr = this.fileListData.filter((item) => {
          return item.type !== "dir";
        });
        return dirArr;
    },
    getFileDirReverse(){
     return  this.getFileDir.reverse();
    }
  },
  data() {
    return {
      sortButtonClass: "",
      // uploader: "",
      loadingText: "正在加载中......",
      isLoading: false,
      img1: "",
      isBorderHover: false,
      modalStyle: { top: "300px" },
      userName: "",
      breadcrumbItemList: [],
      fileResourceManageModal: false,
      showimgsearchicon: true,
      showimgofficon: false,
      searchName: "",
      fileListData: [],
      breadCrumbList: [],
      tableDraggable: true,
      prePathId: "",
      currentPathId: "",//当前导航的目录
      delShow: false,
      createFolderModal: false,
      isFile: false,
      newFileName: "",
      fileInput: false,
      folderInput: true,
      selectData: [], //id  name pid
      dataOfOperate: [], //主要用于复制 和剪切
      isCopy: false,
      iscut: false,
      isOperate: false,
      rootPath: {
        name: "",
        id: "",
      },
      reNameModal: false,
      currentRow: "",

      compressModal: false,
      compressName: "",
      currentCompressSuffix: ".zip",
      suffixOptions: [
        { label: ".zip", value: ".zip" },
        { label: ".tar.gz", value: ".tar.gz" },
        // { label: ".rar", value: ".rar" },
      ],
    };
  },
  created() {
    this.uploader = window.uploader;
  },
  mounted() {
    //拖拽文件上传
    this.AddfileDragEventListener();
    this.userName = window.sessionStorage.getItem("user");
    this.initTree();
    this.$bus.$on("fileSuccess", (res) => {
      if (res.code == 0 && res.success) {
        this.refreshTable();
      }
      console.log(res);
    });
  },
  methods: {
    /*类型排序*/
    sortTypeUp() {
      let that = this;
      this.sortButtonClass = "sortTypeUpClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        let Anum = a.name.lastIndexOf(".") != -1 ? a.name.lastIndexOf(".") : -1;
        let Bnum = b.name.lastIndexOf(".") != -1 ? b.name.lastIndexOf(".") : -1;
        let aData = Anum != -1 ? a.name.slice(Anum) : "-1";
        let bData = Bnum != -1 ? b.name.slice(Bnum) : "-1";
        return (aData > bData) ? 1 : -1;
      })
      that.fileListData = that.getFileDir.concat(fileListArr)
    },
    sortTypeDown() {
      let that = this;
      this.sortButtonClass = "sortTypeDownClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        let Anum = a.name.lastIndexOf(".") != -1 ? a.name.lastIndexOf(".") : -1;
        let Bnum = b.name.lastIndexOf(".") != -1 ? b.name.lastIndexOf(".") : -1;
        let aData = Anum != -1 ? a.name.slice(Anum) : "-1";
        let bData = Bnum != -1 ? b.name.slice(Bnum) : "-1";
        return (aData > bData) ? -1 : 1;
      })
      that.fileListData = fileListArr.concat(that.getFileDir)
    },

    /*名称排序*/
    sortMethodUp() {
      let that = this;
      this.sortButtonClass = "sortMethodUpClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        return a.name > b.name ? 1 : -1;
      })
      that.fileListData = that.getFileDir.concat(fileListArr)
    },
    sortMethodDown() {
      let that = this;
      this.sortButtonClass = "sortMethodDownClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        return a.name > b.name ? -1 : 1;
      })
      that.fileListData = fileListArr.concat(that.getFileDir)
    },

    /*大小排序*/
    fileSize(a = 0) {
      let numA;
      if (a) {
        let num;
        if (a.slice(-2).toUpperCase() == "MB") {
          num = 1024 * 1;
        } else if (a.slice(-2).toUpperCase() == "GB") {
          num = 1024 * 1 * 1024;
        } else {
          num = 1;
        }
        numA = parseFloat(a) * num;
      } else {
        numA = 0;
      }
      return numA
    },
    sortSizeUp() {
      let that = this;
      this.sortButtonClass = "sortSizeUpClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
            return that.fileSize(a.size)>that.fileSize(b.size)?-1:1
      })
      that.fileListData = that.getFileDir.concat(fileListArr)
    },
    sortSizeDown() {
      let that = this;
      this.sortButtonClass = "sortSizeDownClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        return that.fileSize(a.size)>that.fileSize(b.size)?1:-1
      })
      that.fileListData = fileListArr.concat(that.getFileDir)
    },

    /*修改日期排序*/
    sortTimeUp() {
      let that = this;
      this.sortButtonClass = "sortTimeUpClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        return Date.parse(a.time) > Date.parse(b.time) ? -1 : 1;
      })
      let fileListDir = that.getFileDir.sort((a, b) => {
        return Date.parse(a.time) > Date.parse(b.time) ? -1 : 1;
      })
      that.fileListData = fileListDir.concat(fileListArr)

    },
    sortTimeDown() {
      let that = this;
      this.sortButtonClass = "sortTimeDownClass";
      let fileListArr = that.getFileNoDir.sort((a, b) => {
        return Date.parse(a.time) > Date.parse(b.time) ? 1 : -1;
      })
      let fileListDir = that.getFileDir.sort((a, b) => {
        return Date.parse(a.time) > Date.parse(b.time) ? 1 : -1;
      })
      that.fileListData = fileListArr.concat(fileListDir)
    },

/*

    //类型排序
    sortType(a, b, type) {

      if (type == "asc") {
        if (a == b) {
          return -1;
        } else {
          return 1;
        }
      }
      if (type == "desc") {
        if (a == b) {
          return 1;
        } else {
          return -1;
        }
      }

      /!*
       let Anum = a.lastIndexOf(".") != -1 ? a.lastIndexOf(".") : -1;
       let Bnum = b.lastIndexOf(".") != -1 ? b.lastIndexOf(".") : -1;
       let aData = Anum != -1 ? a.slice(Anum) : "-1";
       let bData = Bnum != -1 ? b.slice(Bnum) : "-1";
       if (type == "asc") {
         if (aData > bData) {
           return -1;
         } else {
           return 1;
         }
       }
       if (type == "desc") {
         if (aData < bData) {
           return -1;
         } else {
           return 1;
         }
       }*!/
    },
    //名称排序
    sortMethod(a, b, type) {
      //top asc
      //bottom  desc
      if (type == "asc") {
        if (a > b) {
          return -1;
        } else {
          return 1;
        }
      }
      if (type == "desc") {
        if (a < b) {
          return -1;
        } else {
          return 1;
        }
      }
    },
    //大小排序
    sortSize(a, b, type) {
      let numA = 1;
      let numB = 1;
      if (a != null && a != "undefined" && a != "") {
        let num;
        if (a.slice(-2).toUpperCase() == "MB") {
          num = 1024 * 1;
        } else if (a.slice(-2).toUpperCase() == "GB") {
          num = 1024 * 1 * 1024;
        } else {
          num = 1;
        }
        numA = parseFloat(a) * num;
      } else {
        numA = Infinity;
      }
      if (b != null && b != "undefined" && b != "") {
        let num;
        if (b.slice(-2).toUpperCase() == "MB") {
          num = 1024 * 1;
        } else if (b.slice(-2).toUpperCase() == "GB") {
          num = 1024 * 1 * 1024;
        } else {
          num = 1;
        }
        numB = parseFloat(b) * num;
      } else {
        numB = Infinity;
      }
      if (type == "asc") {

        if (numA > numB && this.sortType(a, b, type) === 1) {
          return -1;
        } else {
          return 1;
        }
      }
      if (type == "desc") {
        if (numA < numB) {
          return -1;
        } else {
          return 1;
        }
      }
    },
    //日期排序
    sortTime(a, b, type) {
      let dataA = Date.parse(a);
      let dataB = Date.parse(b);

      if (type == "asc") {
        if (dataA > dataB) {
          return -1;
        } else {
          return 1;
        }
      }
      if (type == "desc") {
        if (dataA < dataB) {
          return -1;
        } else {
          return 1;
        }
      }
    },
*/

    AddfileDragEventListener() {
      let _this = this;
      var dropbox = document.getElementById("drop_area");
      dropbox.addEventListener("drop", this.enentDrop, false);
      dropbox.addEventListener("dragleave", function (e) {
        e.stopPropagation();
        e.preventDefault();
        // _this.isBorderHover = false;
      });
      dropbox.addEventListener("dragenter", function (e) {
        e.stopPropagation();
        e.preventDefault();
        _this.isBorderHover = true;
      });
      dropbox.addEventListener("dragover", function (e) {
        e.stopPropagation();
        e.preventDefault();
        _this.isBorderHover = true;
      });
    },
    enentDrop: function (e) {
      this.isBorderHover = false;
      e.stopPropagation();
      e.preventDefault(); //必填字段
      let fileData = e.dataTransfer.files;
      window.uploader.opts.query = {folderPath: this.currentPathId};
      window.uploader.addFiles(fileData);
    },

    fileTypeImg(type) {
      // let path="@/assets/icons/fileResource/"
      let img = {
        unknow: require("../../assets/icons/fileResource/unknow.gif"),
        dir: require("@/assets/icons/fileResource/dir.gif"),
        js: require("../../assets/icons/fileResource/js.gif"),
        css: require("../../assets/icons/fileResource/css.gif"),
        xml: require("../../assets/icons/fileResource/xml.gif"),
        pdf: require("../../assets/icons/fileResource/pdf.gif"),
        png: require("../../assets/icons/fileResource/png.gif"),
        jpg: require("../../assets/icons/fileResource/jpg.gif"),
        txt: require("../../assets/icons/fileResource/txt.gif"),
        zip: require("../../assets/icons/fileResource/zip.gif"),
        rar: require("../../assets/icons/fileResource/rar.gif"),
        ppt: require("../../assets/icons/fileResource/ppt.gif"),
        doc: require("../../assets/icons/fileResource/doc.gif"),
        chm: require("../../assets/icons/fileResource/chm.gif"),
        dll: require("../../assets/icons/fileResource/dll.gif"),
        mdb: require("../../assets/icons/fileResource/mdb.gif"),
        pdb: require("../../assets/icons/fileResource/pdb.gif"),
        sln: require("../../assets/icons/fileResource/sln.gif"),
        cs: require("../../assets/icons/fileResource/cs.gif"),
        swf: require("../../assets/icons/fileResource/swf.gif"),
        bmp: require("../../assets/icons/fileResource/bmp.gif"),
        config: require("../../assets/icons/fileResource/config.gif"),
        ashx: require("../../assets/icons/fileResource/ashx.gif"),
        htm: require("../../assets/icons/fileResource/htm.gif"),
        html: require("../../assets/icons/fileResource/html.gif"),
        wmv: require("../../assets/icons/fileResource/wmv.gif"),
      };
      if (img[type] == undefined) return img["unknow"];
      else return img[type];
    },
    handleEdit(row, index) {
      this.$set(row, "$isEdit", true);
    },
    handleSave(row, index) {
      this.index = -1;
      this.$set(row, "$isEdit", false);
    },
    //初始化树结构
    initTree() {
      if (this.$route.params && this.$route.params.type === "downLoadFile") {
        this.ztreeDownLoadFile();
      } else {
        this.ztreeSetting();
      }
    },
    // 下载文件跳转进来
    ztreeDownLoadFile() {
      let that = this;
      let path = that.$api.processingApi.getFileTree;
      let param = this.$route.params ? this.$route.params.dataList : "";
      let setting = {
        data: {
          simpleData: {
            enable: true,
          },
        },
        callback: {
          onClick: this.zTreeOnClick,
          onCheck: this.zTreeOnCheck,
          onExpand: this.zTreeOnClick, //this.zTreeOnClick,
        },
        view: {
          showLine: false,
        },
      };

      this.http
              .get(path, param)
              .then((res) => {
                let data = res.data;
                if (data.success) {
                  that.ztreeObjInstance = $.fn.zTree.init($("#treeDemo"), setting, data.data);
                  if (that.ztreeObjInstance) {
                    //扁平化数组
                    let nodes = that.ztreeObjInstance.transformToArray(
                            that.ztreeObjInstance.getNodes()
                    );
                    //当前节点
                    let correntNode = nodes.find((item) => {
                      return item.checked
                      /*  if (item.id === path.id) {
                          item._checked = true;
                          return true;
                        }*/
                    });
                    //获取根节点
                    let rootNode = nodes[0];
                    if (rootNode.pid == null) {
                      that.rootPath.id = rootNode.id;
                      that.rootPath.name = rootNode.name;
                    }
                    //当前节点的父节点
                    let parentNode = correntNode.getParentNode();

                    this.currentPathId = parentNode.id;
                    //表格赋值
                    that.fileListData = parentNode.children;
                    that.sortTypeUp();
                    //过滤子集中的文件
                    parentNode.children = parentNode.children.filter((item) => {
                      return item.type !== "file";
                    });
                    //展开当前节点
                    that.ztreeObjInstance.expandNode(parentNode, true, false, false);
                    //选择节点
                    that.ztreeObjInstance.selectNode(parentNode, false);
                    //目录导航
                    that.getBreadCrumbItem(parentNode);
                    //刷新左侧组织机构树
                    that.$bus.$emit("getCatalog");
                    that.selectData.push(correntNode);
                  }
                }
              })
              .catch((res) => {
                that.$Message.error("网络错误,请稍后重试");
              });
    },

    ztreeSetting() {
      let _this = this;
      // let checkType = { Y: "", N: "" }; //父与子的关联去掉
      let setting = {
        // check: {
        //   enable: true,
        //   nocheckInherit: false,
        //   chkboxType: checkType,
        // },
        data: {
          simpleData: {
            enable: true,
          },
        },
        callback: {
          onClick: this.zTreeOnClick,
          onCheck: this.zTreeOnCheck,
          onExpand: this.zTreeOnClick, //this.zTreeOnClick,
        },
        view: {
          showLine: false,
        },
      };

      let path = this.$api.processingApi.getCatalogList;
      let param = {
        username: _this.userName,
        showFile: false,
      };
      this.http.get(path, param).then((res) => {
        let data = res.data;
        let dataList = data.data;
        if (data.success) {
          this.ztreeObjInstance = $.fn.zTree.init($("#treeDemo"), setting, data.data);

          _this.currentPathId = dataList[0].id;
          _this.getBreadCrumbItem(dataList[0]);
          // _this.getFileTableData(dataList[0].children);//没有文件信息
          _this.refreshTable();
          let nodes = this.ztreeObjInstance.getNodes();
          this.ztreeObjInstance.expandNode(nodes[0], true, false, false);
          // this.ztreeObjInstance.expandNode(nodes[1], true, false, false);
          this.ztreeObjInstance.selectNode(nodes[0], false);
        }
      });
    },
    zTreeOnClick(event, treeId, treeNode) {
      let _this = this;
      _this.selectData = []
      _this.currentPathId = treeNode.id;
      var treeObj = $.fn.zTree.getZTreeObj(treeId);
      treeObj.selectNode(treeNode);
      let sNode = treeObj.getSelectedNodes();

      if (sNode.length > 0) {
        // let zAsync = sNode[0].zAsync;
        // treeObj.reAsyncChildNodes(treeNode, "refresh");

        let zAsync = treeNode.children == null ? false : true;
        if (zAsync) {
          this.zTreeOnClickOperateByStatus(treeObj, treeNode, sNode, true); //不添加节点=》不更新节点
        } else {
          this.zTreeOnClickOperateByStatus(treeObj, treeNode, sNode, false); //请求新的节点=》更新节点
        }
      }
    },

    zTreeOnClickOperateByStatus(treeObj, treeNode, sNode, zAsync) {
      let _this = this;
      let path = this.$api.processingApi.getCatalogList;

      let param = {
        username: _this.userName,
        pid: treeNode.id,
        showFile: false,
      };

      this.http.get(path, param).then((res) => {
        let data = res.data;
        if (data.success == true) {
          if (!zAsync) {
            treeNode.halfCheck = false;
            treeObj.removeChildNodes(treeNode);
            treeObj.addNodes(treeNode, data.data, false);
            sNode[0].zAsync = true;
          }
          _this.refreshTable();
          _this.getBreadCrumbItem(treeNode);
        }
      });
    },

    zTreeOnCheck(event, treeId, treeNode) {
      // var treeObj = $.fn.zTree.getZTreeObj(treeId),
      //   nodes = treeObj.getCheckedNodes(true);
    },
    path(index) {
    },
    rowDbclick(item) {
      let _this = this;
      if (!item.isParent) {
        _this.$message.warning("文件类型暂时无法查看！");
        return;
      }
      _this.currentPathId = item.id;
      _this.prePathId = item.id;
      let path = this.$api.processingApi.getCatalogList;

      let param = {
        username: _this.userName,
        pid: item.id,
      };
      this.http.get(path, param).then((res) => {
        let data = res.data;
        if (data.success) {
          _this.getFileTableData(data.data);
          _this.getBreadCrumbItem(item);
          _this.bindZtree();
          $("#upLevelbtn").attr("disabled", false);
        }
      });
    },

    bindZtree() {
      let _this = this;
      let treeObj = this.ztreeObjInstance;
      var node = treeObj.getNodeByParam("id", _this.currentPathId, null);
      if (node != null) {
        let parentNode = node.getParentNode();
        if (parentNode == null && node.parentTId == null) {
          //root
          treeObj.selectNode(node, false);
        } else if (parentNode.open) {
          treeObj.selectNode(node, false);
        } else {
          //父节点没有展开时，不选中该节点， 父节点为选中状态
          treeObj.selectNode(parentNode, false);
        }
      }
    },
    getBreadCrumbItem(data) {
      let _this = this;
      _this.breadcrumbItemList = [];

      if (data.pid == null) {
        //根节点
        _this.rootPath.id = data.id;
        _this.rootPath.name = data.name;
      }
      if (data.id === this.rootPath.id) {
        let obj = {};
        obj.name = data.name;
        obj.id = data.id;
        _this.breadcrumbItemList.push(obj);
        return;
      }

      let rootObj = {};
      rootObj.name = _this.rootPath.name;
      _this.breadcrumbItemList.push(rootObj);
      let arr = data.id.substring(this.rootPath.id.length, data.id.length).split("/");

      for (let i = 0; i < arr.length; i++) {
        if (arr[i] == "") continue;
        let tempObj = {};
        tempObj.name = arr[i];
        _this.breadcrumbItemList.push(tempObj);
      }
    },

    breadCrumbChange(item, index) {
      if (index == this.breadcrumbItemList.length - 1 || index < 0) {
        $("#upLevelbtn").attr("disabled", true);
        return;
      } else {
        $("#upLevelbtn").attr("disabled", false);
      }

      for (let i = this.breadcrumbItemList.length - 1; i > index; i--) {
        this.breadcrumbItemList.splice(i, 1);
      }
      let fullPath = this.rootPath.id;
      for (let i = 1; i <= index; i++) {
        if (i == 1) {
          //把根目录给提取出来
          fullPath = fullPath + "/";
        }
        if (i == index) {
          fullPath += this.breadcrumbItemList[i].name;
        } else {
          fullPath += this.breadcrumbItemList[i].name + "/";
        }
      }

      this.currentPathId = fullPath;
      this.bindZtree();
      this.refreshTable();
    },
    getFileTableData(data) {
      let _this = this;
      _this.fileListData = [];
      data.forEach((element) => {
        let temp = {};
        temp.type = element.type;
        temp.size = element.size;
        temp.time = element.time;
        temp.name = element.name;
        temp.pid = element.pid;
        temp.id = element.id;
        temp.isParent = element.isParent;
        if (element.type !== "dir") {
          let arr = element.id.split(".");
          temp.suffix = arr[arr.length - 1];
        } else {
          temp.suffix = "dir";
        }
        _this.fileListData.push(temp);
        _this.sortTypeUp();
      });
    },
    getRootDirectory() {
      let _this = this;
      let path = this.$api.processingApi.getCatalogList;

      let param = {
        username: _this.userName,
      };
      this.http.get(path, param).then((res) => {
        let data = res.data;
        if (data.success) {
          _this.getFileTableData(data.data[0].children);
          _this.getBreadCrumbItem(_this.rootPath);
          _this.currentPathId = _this.rootPath.id;
        }
      });
    },
    up() {
      let length = this.breadcrumbItemList.length;
      this.breadCrumbChange("", length - 2);
    },
    reName() {
      // item.$isEdit = true;
      let _this = this;
      if (_this.selectData.length < 1) {
        _this.$message.warning("请选择需要重命名的文件~");
        return;
      }
      if (_this.selectData.length > 1) {
        _this.$message.warning("请选择一个文件进行重命名~");
        return;
      }
      this.reNameModal = true;
      this.newFileName = this.selectData[0].name;
      this.currentRow = this.selectData[0];
    },
    refreshTable() {
      // if (!(this.$route.params && this.$route.params.type === "downLoadFile")) { return }
      let _this = this;
      let path = this.$api.processingApi.getCatalogList;

      let param = {
        username: _this.userName,
        pid: _this.currentPathId,
      };
      this.http.get(path, param).then((res) => {
        let data = res.data;
        if (data.success) {
          _this.getFileTableData(data.data);
        }
      });
    },
    createNewFile() {
      let _this = this;
      _this.newFileName = ""; //界面文件名置为空
      _this.isFile = true;

      _this.createFolderModal = true;
      _this.fileInput = true;
      _this.folderInput = false;
    },
    createNewFolder() {
      let _this = this;
      _this.newFileName = ""; //界面文件夹名置为空
      _this.isFile = false;

      _this.createFolderModal = true;
      _this.fileInput = false;
      _this.folderInput = true;
    },
    createFolderOrFileCancel() {
      this.createFolderModal = false;
    },
    createFolderOrFileOk() {
      let _this = this;
      let fileName = _this.newFileName;

      if (fileName == null || fileName == "") {
        this.$Message.warning("文件夹名称为空，请重写填写");
        return;
      }
      if (this.isFile) {
        //文件 判断文件名是否符合带后缀
        let a = fileName.split("").reverse().join("");
        let b = a.substring(0, a.search(/\./)).split("").reverse().join("");
        if (b == null || b == "") {
          this.$Message.warning("该文件名无效，没有后缀");
          return;
        }
        let path = _this.$api.processingApi.createFile;
        this.createNewFileOrFolder(path, fileName, false);
      } else {
        let path = _this.$api.processingApi.createFolder;
        this.createNewFileOrFolder(path, fileName, true);
      }
    },

    createNewFileOrFolder(path, fileName, isFolder) {
      let _this = this;
      let param = {
        name: fileName,
        pid: _this.currentPathId,
      };
      _this.http.post(path, param).then((res) => {
        if (res.data.code == 0 && res.data.success) {
          this.createFolderModal = false;
          _this.refreshTable();
          if (isFolder) {
            let obj = {};
            obj.name = fileName;
            let arr = [];
            arr.push(obj);
            this.addNewFolderNodeToTree(arr);
          }
          _this.$Message.success("创建成功~");
        } else {
          _this.$message.error(res.data.message);
        }
      });
    },

    addNewFolderNodeToTree(folderList) {
      //将新增文件夹节点信息追加到对应树节点
      let treeObj = this.ztreeObjInstance;

      let selectNode = treeObj.getNodeByParam("id", this.currentPathId);
      if (selectNode == null) return;
      let newNodes = [];
      folderList.forEach((ele) => {
        console.log("addNewFolderNodeToTree  id", selectNode);
        let newNode = {
          name: ele.name,
          id: selectNode.id + "/" + ele.name,
          pid: selectNode,
          isParent: true,
        };
        newNodes.push(newNode);
      });
      if (newNodes.length < 1) return;
      treeObj.addNodes(selectNode, newNodes, true);
    },
    deleteZtreeNode() {
      //列表数据删除时ztree数据要对应删除
      let treeObj = this.ztreeObjInstance;
      let selectNode = treeObj.getNodeByParam("id", this.currentPathId);
      if (selectNode == null || selectNode == undefined) return;
      let idList = this.getSelectedPath();
      idList.forEach((ele) => {
        let currentNode = treeObj.getNodeByParam("id", ele);
        if (currentNode != null || currentNode != undefined) {
          treeObj.removeNode(currentNode);
        }
      });
      if (!selectNode.isParent) {
        //避免改节点下没有子节点时，将父节点的isparent设置位fasle
        selectNode.isParent = true;
        // selectNode.open = true;
        treeObj.updateNode(selectNode);
      }
    },

    refreshTreeNode() {
      let treeObj = this.ztreeObjInstance;
      let node = treeObj.getNodeByParam("id", this.currentPathId);
      treeObj.selectNode(node, false);
      let selectNode = treeObj.getSelectedNodes();

      this.zTreeOnClickOperateByStatus(treeObj, selectNode[0], selectNode, false);
    },
    updateNodeName(nodeId, newName) {
      let treeObj = this.ztreeObjInstance;
      let node = treeObj.getNodeByParam("id", nodeId);

      if (node == null || node == undefined) return;
      node.name = newName;
      let newId = node.pid + "/" + newName;
      this.updateNodeByNewName(nodeId, newId);
      node.id = newId;
      treeObj.updateNode(node);
    },
    updateNodeByNewName(oldId, newid) {
      let treeObj = this.ztreeObjInstance;
      let node = treeObj.getNodeByParam("id", oldId);
      if (node == null) return;

      //1、更新父节点的children为节点信息  ：id信息
      let parentNodeChilds = node.getParentNode().children;
      for (let i = 0; i < parentNodeChilds.length; i++) {
        if (parentNodeChilds[i].id == oldId) {
          parentNodeChilds[i].id = newid;
          break;
        }
      }
      //2、更新该节点的子节点的pid和id
      if (node.children == null || node.children == undefined) return;
      node.children.forEach((ele) => {
        ele.pid = newid;
        ele.id = newid + "/" + ele.name;
        treeObj.updateNode(ele);
      });
    },
    selectChange(data) {
      let _this = this;
      _this.selectData = [];
      data.forEach((ele) => {
        _this.selectData.push(ele);
      });
    },
    delCancel() {
      this.delShow = false;
    },
    delOk() {
      let _this = this;
      this.delShow = false;
      let path = _this.$api.processingApi.fileDelete;
      if (_this.selectData.length < 1) {
        _this.$message.warning("请选择需要删除的文件~");
        return;
      }

      let idList = this.getSelectedPath();
      let param = {
        ids: idList,
      };
      this.isLoading = true;
      this.loadingText = "正在删除中,请稍后....";
      _this.http.post(path, param).then((res) => {
        if (res.data.success) {
          _this.refreshTable();
          _this.deleteZtreeNode();
          this.isLoading = false;
          _this.selectData = [];
          _this.$message.success(res.data.message);
        } else {
          _this.$message.error(res.data.message);
        }
      });
    },
    deleteFile() {
      let _this = this;
      if (_this.selectData.length < 1) {
        _this.$message.warning("请选择需要删除的文件~");
        return;
      } else this.delShow = true;
    },

    copy() {
      let _this = this;
      if (_this.selectData.length < 1) {
        _this.$message.warning("请选择需要复制的文件~");
        this.isCopy = false;
        return;
      } else if (this.iscut) {
        this.isCopy = false;
      } else {
        this.isCopy = true;
        this.dataOfOperate = this.getSelectedPath();
      }
    },
    cut() {
      let _this = this;
      if (_this.selectData.length < 1) {
        _this.$message.warning("请选择需要剪切的文件~");
        this.iscut = false;
        return;
      } else if (this.isCopy) {
        this.iscut = false;
      } else {
        this.iscut = true;
        this.dataOfOperate = this.getSelectedPath();
      }
    },
    getSelectedPath() {
      let idList = [];
      this.selectData.forEach((ele) => {
        idList.push(ele.id);
      });
      return idList;
    },
    selectFolderData() {
      let folderList = [];
      this.selectData.forEach((ele) => {
        if (ele.isParent) {
          folderList.push(ele);
        }
      });
      return folderList;
    },
    paste() {
      let _this = this;
      if ((!this.isCopy || !this.iscut) && _this.dataOfOperate.length < 1) {
        _this.$message.warning("请选择需要粘贴的文件~");
        return;
      }

      let type = "copy";
      if (this.iscut) {
        type = "move";
      }
      let path = _this.$api.processingApi.doCheckBefore;
      let idList = this.getSelectedPath();
      let param = {
        sourceIdList: idList,
        targetId: _this.currentPathId,
        type: type,
      };
      this.isLoading = true;
      this.loadingText = "正在粘贴中,请稍后....";
      _this.pasteData(idList);
      return;
      _this.http.post(path, param).then((res) => {
        if (res.data.success) {
          _this.pasteData(idList);
          return;
        } else {
          _this.$message.error(res.data.message);
        }
      });
    },
    pasteData(idList) {
      let _this = this;
      let path = _this.$api.processingApi.operate;

      let type = "copy";
      if (this.iscut) {
        type = "move";
      }
      let param = {
        confirmType: "both", //重复文件的确认类型(both(保留双方)/cover(覆盖)/skip(跳过))
        sourceIdList: idList,
        targetId: _this.currentPathId,
        type: type,
      };

      _this.http.post(path, param).then((res) => {
        if (res.data.success) {
          this.isLoading = false;
          _this.iscut = false;
          _this.isCopy = false;
          _this.dataOfOperate = [];
          _this.refreshTable();
          _this.refreshTreeNode();
          // _this.addNewFolderNodeToTree(_this.selectFolderData());

          _this.$message.success(res.data.message);
        } else {
          _this.$message.error(res.data.message);
        }
      });
    },

    reNameOk() {
      this.reNameModal = false;
      let path = this.$api.processingApi.rename;
      let param = {
        id: this.currentRow.id,
        newName: this.newFileName,
      };
      this.http.post(path, param).then((res) => {
        if (res.data.code == 0 && res.data.success) {
          this.$message.success(res.data.message);
          this.refreshTable();
          this.updateNodeName(this.currentRow.id, this.newFileName);
        } else {
          this.$message.error(res.data.message);
        }
      });
    },
    reNameCancel() {
      this.reNameModal = false;
    },
    unCompress() {
      if (this.selectData.length < 1) {
        this.$message.warning("请选择需要解压的文件~");
        return;
      }

      let path = this.$api.processingApi.unCompress;
      let param = {
        dirFile: this.selectData[0].pid, //解压文件存放目录(可不填,默认为压缩包
        fileName: this.selectData[0].id, //压缩包文件全路径
      };
      this.isLoading = true;
      this.loadingText = "正在解压中,请稍后....";
      this.http.post(path, param).then((res) => {
        if (res.data.code == 0 && res.data.success) {
          this.refreshTable();
          this.isLoading = false;
          this.$message.success(res.data.message);
        } else {
          this.$message.error(res.data.message);
        }
      });
    },
    compress() {
      if (this.selectData.length < 1) {
        this.$message.warning("请选择需要压缩的文件~");
        return;
      }
      this.compressModal = true;
      let arr = [];
      arr = this.selectData[0].id.split("/");
      if (this.selectData.length == 1) {
        this.compressName = arr[arr.length - 1].split(".")[0];
      } else {
        this.compressName = arr[arr.length - 2];
      }
    },

    compressOk() {
      let path = this.$api.processingApi.compress;
      // let index = this.selectData[0].id.lastIndexOf("/");
      // let parentPath = this.selectData[0].id.substring(0, index);
      let idList = this.getSelectedPath();
      let param = {
        dirfileName: this.selectData[0].pid, //压缩路径
        fileName: this.compressName, //可不填 压缩包名称(可不填)
        pids: idList, //压缩文件(文件或文件夹)
        suffix: this.currentCompressSuffix, //.zip/.tar.gz
      };
      this.compressModal = false;
      this.isLoading = true;
      this.loadingText = "正在压缩中,请稍后....";
      this.http.post(path, param).then((res) => {
        if (res.data.code == 0 && res.data.success) {
          this.refreshTable();
          this.isLoading = false;
          this.$message.success(res.data.message);
        } else {
          this.$message.error(res.data.message);
        }
      });
    },
    compressCancel() {
      this.compressModal = false;
    },
    getDownLoadKey() {

      if (this.selectData.length < 1) {
        this.$message.warning("请选择需要下载的文件~");
        return;
      }
      let path = this.$api.processingApi.getDownLoadKey;
      let idList = this.getSelectedPath();
      this.isLoading = true;
      this.loadingText = "正在下载中,请稍后....";
      this.http.post(path, idList).then((res) => {
        if (res.data.code == 0 && res.data.success) {
          // this.selectData = [];
          this.downloadFile(res.data.data);
        } else {
          this.isLoading = false;
          this.$message.error(res.data.message);
        }
      });
    },

    downloadFile(key) {
      if (key == null || key == undefined) return;
      // let path = this.$api.processingApi.download + "?key=" + key;
      // window.open(key,"_blank")
      window.location.href = key;
      //下载页面跳转进来,不刷新左侧树
      // this.refreshTable();
      this.isLoading = false;
    },

    uploaderFile() {
      Bus.$emit("openUploader", {
        // id: "1111", // 传入的参数
        folderPath: this.currentPathId,
      });
    },

    uploaderFolder() {
      Bus.$emit("openFolderUploader", {
        folderPath: this.currentPathId,
      });
    },

    uploaderFilelist() {
      Bus.$emit("showUploaderFilelist");
    },
  },
  beforeRouteLeave(to, from, next) {
    next();
    Bus.$emit("hideLoaderFilelist");
  },
};
</script>

<style scoped>
.leftCard {
  width: 20%;
  border-bottom: none;
  border-top: none;
}
.rightCard {
  width: 80%;
  border-bottom: none;
  border-top: none;
}
.contentRow {
}
.modalContent {
  display: flex;
}
.treeDiv {
  height: 82vh;
  overflow-y: auto;
}

.contentHeader {
  display: flex;

  width: 100%;
  height: 38px;
  border-bottom: 1px solid #5a565659;
  align-items: center;
  margin-left: 10px;
}

.operationNavDiv {
  flex-wrap: wrap;
}
.fileTableStyle {
  width: 98%;
  margin: 20px 10px;
  text-align: center;
}
.ivu-table-tip {
  overflow-x: hidden !important;
}

.borderHover {
  background-color: #7aa0da;
  border: 3px dotted #7aa0da;
}
.noBorderHover {
  background-color: #bbbbbb;
}
.dragTitle {
  width: 100%;
  text-align: center;
  color: white;
}

/* .div2style {
  display: flex;
  margin-top: 7px;
  margin-left: 5px;
  justify-content: space-between;
  float: right;
}
.textTitle {
  margin-top: 5px;
  margin-right: 10px;
  font-size: 18px;
}
.iconstylesearch {
  margin-top: 7px;
  margin-left: -25px;
  width: 20px;
  height: 20px;
}
.iconstyleoff {
  margin-top: 7px;
  margin-left: -25px;
  width: 20px;
  height: 20px;
} */

.demo-spin-icon-load {
  animation: ani-demo-spin 1s linear infinite;
}
.ivu-spin-fix {
  background-color: rgba(255, 255, 255, 0.2) !important;
}


</style>
